import React from 'react';
import { Flex, WingBlank, WhiteSpace, List,Card, Progress } from 'antd-mobile';
import { SCALE_TCM_VALUE } from 'const';

const { Item, Item: { Brief } } = List;

export default function ScaleReport(props) {
  window.scrollTo(0, 0);
  // 科研版体质辨识报告页面
  let a = [], b = [];
  let patientvalue = [];
  if (props.PatientValue.patientValue1 && props.PatientValue.patientValue1.indexOf("|") == -1) {
    const Tcm = props.PatientValue.patientValue1.split(',');
    for (var i = Tcm.length - 1; i >= 0; i--) {
       for (var j = SCALE_TCM_VALUE.length - 1; j >= 0; j--) {
        if (SCALE_TCM_VALUE[j].id == Tcm[i]) {
          patientvalue.push(SCALE_TCM_VALUE[j]);
        }
      }
    }
   for (var z = patientvalue.length - 1; z >= 0; z--) {
      if(patientvalue[z].id>=102 && patientvalue[z].id<=144){
        b.push(patientvalue[z].title)
      }else{
        a.push(patientvalue[z].title)
      }
    }
 }  
  return (
    <WingBlank size="md">
      <List wrap>
        <Item>
          <Flex justify="center">四诊合参体质辨识报告</Flex>
          <WhiteSpace/>
          <Flex justify="end">
              <div style={{fontSize: '0.25rem'}}>
                  {props.createTime}
              </div>
          </Flex>
        </Item>
        <Item >
          主要症状
          <Brief style={{whiteSpace: "normal",textIndent: "2em"}}>
             {a.join("; ")}
          </Brief>
          <WhiteSpace size="lg" />
        </Item>
        <Item extra={null}>
          舌脉症状
          <Brief style={{whiteSpace: "normal",textIndent: "2em"}}>
             {b.join("; ")}    
          </Brief>
          <WhiteSpace size="lg" />
        </Item>
        <Item extra={null}>
          体质辨识结果
          <Brief style={{whiteSpace: "normal",textIndent: "2em"}}>
             {props.report2}
          </Brief>
          <WhiteSpace size="lg" />
        </Item>
        <Item >
          中医辨证结果
          <Brief style={{whiteSpace: "normal",textIndent: "2em"}}>
             {props.report1}
          </Brief>
        </Item>
       
      </List>
    </WingBlank>
  );
}
